﻿using AttributeRouting.Web.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Water.Model;

namespace Water.RestService.Controllers
{
    public class SmallValveOperatePlanController : ApiController
    {
        private SmallValveOperatePlan svop;
        private SmallValveOperatePlanQuery svopq;

        [POST("AddSmallValveOperatePlan")]
        public bool PostAddSmallValveOperatePlan(SmallValveOperatePlan psvop)
        {
            svop = new SmallValveOperatePlan();            
            return svop.AddSmallValveOperatePlan(psvop) > 0 ? true : false;
        }

        [GET("DeleteSmallValveOperatePlan/{mrno}/{vid}")]
        public bool GetDeleteSmallValveOperatePlan(string mrno,string vid)
        {
            svop = new SmallValveOperatePlan();
            return svop.DeleteSmallValveOperatePlan(mrno,vid) > 0 ? true : false;
        }

        [GET("GetSmallValveOperatePlanQuery/{mrno}")]
        public SmallValveOperatePlanQuery GetSmallValveOperatePlanQuery(string mrno)
        {
            svopq = new SmallValveOperatePlanQuery();
            return svopq.GetSmallValveOperatePlanQuery(mrno);
        }
    }
}
